<?php
	ob_end_flush();
	if ($action['xpath']) {
		$targets = $xpath->query($action['xpath']);
	} else {
		$targets = array($tag);
	}

	$newNode = $dom->createDocumentFragment();
	$newNode->appendXML($this->php2cdata($actionXML));
	
	foreach($targets as $target) {
		$target->parentNode->insertBefore($newNode, $target);
	}
?>